<?php

namespace App\Models;

use Illuminate\Database\Eloquent\Model;

class AfterSale extends Model
{
    public function setAcceptImgAttribute($image)
    {
        if (is_array($image)) {
            $this->attributes['accept_img'] = json_encode($image);
        }
    }

    public function getAcceptImgAttribute($image)
    {
        return json_decode($image, true);
    }

    public function setProcessImgAttribute($image)
    {
        if (is_array($image)) {
            $this->attributes['process_img'] = json_encode($image);
        }
    }

    public function getProcessImgAttribute($image)
    {
        return json_decode($image, true);
    }

    public function setPolicyImgAttribute($image)
    {
        if (is_array($image)) {
            $this->attributes['policy_img'] = json_encode($image);
        }
    }

    public function getPolicyImgAttribute($image)
    {
        return json_decode($image, true);
    }
}
